Loading TOC...

POST /manage/v2/databases/{id|name}/super-databases

Summary

Create a new database and make it a super-database of the database identified by {id|name}.

Request Headers
Content-type The MIME type of the data in the request body. Supported values: application/xml, application/json.
Response Headers
Location A reference to the newly created database that can be used to construct a URL for the resource that is usable in subsequent requests. For example, /manage/v2/databases/15326391285115269194/super-databases/superdb.

Response

Upon success, MarkLogic server returns status code 201 (Created).

Required Privileges

This operation requires the manage-admin role, or the following privilege:

http://marklogic.com/xdmp/privileges/manage-admin

Usage Notes

The new super-database inherits the configuration of the sub-database on whose behalf it was created.

For details, see tieredstorage:database-create-super-database and Tiered Storage in the Administrator's Guide.

The structure of the data in the request body is as follows:

database-name

The database name.

Example


$ cat superdb-create.xml
==> 
<super-database xmlns="http://marklogic.com/manage">
  <database-name>super-db</database-name>
</super-database>

$ curl --anyauth --user user:password -X POST -d @./superdb-create.xml \
    -i -H "Content-type: application/xml" \
    http://localhost:8002/manage/v2/databases/sub-2/super-databases

==> Create a database named super-db and make it the super-database of sub-2.
    MarkLogic Server responds with status code 201 (Created) and headers
    similar to the following:

HTTP/1.1 201 Created
Content-type: application/xml
Cache-Control: no-cache
Expires: -1
Server: MarkLogic
Content-Length: 0
Connection: Keep-Alive
Keep-Alive: timeout=5
    

Example


$ cat superdb-create.json
==> 
{
  "database-name": "super-db",
}

$ curl --anyauth --user user:password -X POST -d @./superdb-create.json \
    -i -H "Content-type: application/json" \
    http://localhost:8002/manage/v2/databases/sub-2/super-databases

==> Create a database named super-db and make the super-database of sub-2.
    MarkLogic Server responds with status code 201 (Created) and headers
    similar to the following:

HTTP/1.1 201 Created
Content-type: application/xml
Cache-Control: no-cache
Expires: -1
Server: MarkLogic
Content-Length: 0
Connection: Keep-Alive
Keep-Alive: timeout=5
    

Stack Overflow iconStack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.